
--#include "data\functions\Scene\RechargeScene.lua" once

local npcId = 208
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]

t.main = function(sysarg)
	local sceneId 	= Actor.getSceneId( sysarg )
	local mapCfg 	= GeRechargeSceneMapCfgBySceneId( sceneId )
	local nextMapIdx = 0
	if not mapCfg then
		nextMapIdx = 1
	else
		nextMapIdx = mapCfg.mapIdx + 1
	end
	local mapSts = GetRechargeSceneMapSts( sceneId )
	--print("208, mapSts="..mapSts)
	if mapSts == 0 then 			--场景外
		local nextMapCfg = RechargeSceneConfig[nextMapIdx]
		if not nextMapCfg then
			return
		end

		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonEnter, "EnterRechargeSceneFromNpc" }		--{按钮;样式;按钮名;函数名;描述}
		CommonNpcDialog( sysarg, nextMapCfg, 0, 0, Lang.ScriptTips.RechargeSceneDesc00, functions, NpcDialogType.GeneralNpcDlg )
	elseif mapSts == 1 then 		--首层
		local nextMapCfg = RechargeSceneConfig[nextMapIdx]
		if not nextMapCfg then
			return
		end

		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonExit, "QuitRechargeSceneFromNpc" }
		functions[2] = { Lang.ScriptTips.ButtonEnterNext, "NexttRechargeSceneFromNpc" }
		CommonNpcDialog( sysarg, nextMapCfg, 0, 0, mapCfg.npcDesc, functions, NpcDialogType.GeneralNpcDlg )
	elseif mapSts == 2 then 		--场景内（非首层、顶层）
		local nextMapCfg = RechargeSceneConfig[nextMapIdx]
		if not nextMapCfg then
			return
		end

		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonExit, "QuitRechargeSceneFromNpc" }
		functions[2] = { Lang.ScriptTips.ButtonEnterNext, "NexttRechargeSceneFromNpc" }
		CommonNpcDialog( sysarg, nextMapCfg, 0, 0, mapCfg.npcDesc, functions, NpcDialogType.GeneralNpcDlg )
	elseif mapSts == 3 then 		--顶层
		local nextMapCfg 	= nil 		--没有下一层
		local functions 	= {}
		functions[1] 		= { Lang.ScriptTips.ButtonExit, "QuitRechargeSceneFromNpc" }
		local extConds 		= {}
		extConds[1]			= Lang.ScriptTips.TopLevelFormat
		CommonNpcDialog( sysarg, nextMapCfg, 0, 0, mapCfg.npcDesc, functions, NpcDialogType.GeneralNpcDlg, extConds )
	end
	------------------
end

--进入狂暴地图
t.EnterRechargeSceneFromNpc = function ( sysarg )
	--print("EnterBossHomeFromNpc...")
	Actor.closeNPCDialog(sysarg)
	EnterRechargeSceneFromNpc( sysarg )
end

--进入下一层
t.NexttRechargeSceneFromNpc = function ( sysarg )
	--print("NexttRechargeSceneFromNpc...")
	Actor.closeNPCDialog(sysarg)
	NextRechargeSceneFromNpc( sysarg )
end

--退出狂暴地图
t.QuitRechargeSceneFromNpc = function ( sysarg )
	--print("QuitRechargeSceneFromNpc...")
	Actor.closeNPCDialog(sysarg)
	QuitRechargeSceneFromNpc( sysarg )
end


